package com.mall.enums;

import lombok.Getter;

/**
 * 成功 0
 * 密码错误 1
 *
 */
@Getter
public enum GlobalResponseEnum {
    ERROR(-1,"服务端错误"),
    SUCCESS(0,"成功"),
    PASSWORD_ERROR(1,"密码错误"),
    USERNAME_EXIST(2,"用户名已存在"),
    PARAM_ERROR(3,"参数错误"),
    EMAIL_EXIST(4,"邮箱已存在"),
    NEED_LOGIN(10,"用户未登录,请先登录"),
    USER_OR_PASSWORD_ERROR(11,"用户名或密码错误"),
    JSON_FORMAT_ERROR(12,"JSON格式错误"),
    PRODUCT_OFF_SALE_OR_DELETE(13,"商品下架或删除"),
    PRODUCT_NOT_EXIST(14,"商品不存在"),
    PRODUCT_STOCK_ERROR(14,"库存有误"),

    PRODUCT_NOT_IN_CART(15,"商品不在购物车中"),

    DELETE_SHIPPING_FAIL(16,"删除收货地址失败"),

    SHIPPING_NOT_EXIST(17,"收获地址不存在"),

    CART_SELECTED_IS_EMPTY(18,"请选择商品后下单"),

    ORDER_NOT_EXIST(19,"订单不存在"),

    UNDO_PAID_ORDER_ERROR(20,"订单已付款，无法被取消"),

    ORDER_STATUS_ERROR(21,"订单状态错误")
    ;
    Integer code;
    String description;
    GlobalResponseEnum(Integer code,String description){
        this.code = code;
        this.description = description;
    }
}
